#include "StdAfx.h"
#include "sa_TwFont.h"

sa_TwFont::sa_TwFont(void)
{
}

sa_TwFont::~sa_TwFont(void)
{
}
void sa_TwFont::Init()
{
	D3DXCreateFont(g_Render->GetDevice(),    // the D3D Device
		30,    // font height of 30
		0,    // default font width
		FW_NORMAL,    // font weight
		1,    // not using MipLevels
		true,    // italic font
		DEFAULT_CHARSET,    // default character set
		OUT_DEFAULT_PRECIS,    // default OutputPrecision,
		DEFAULT_QUALITY,    // default Quality
		DEFAULT_PITCH | FF_DONTCARE,    // default pitch and family
		(LPCSTR)"Arial",    // use Facename Arial
		&dxfont);    // the font object


}
void sa_TwFont::Render()
{
	// clear the window to a deep blue
	g_Render->GetDevice()->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);

	g_Render->GetDevice()->BeginScene();    // begins the 3D scene

	// create a RECT to contain the text
	static RECT textbox; SetRect(&textbox, 0, 0, 640, 480); 

	// draw the Hello World text
	dxfont->DrawTextA(NULL,
		(LPCSTR)"Hello World...FINALLY!",
		22,
		&textbox,
		DT_CENTER | DT_VCENTER,
		D3DCOLOR_ARGB(255, 255, 255, 255));

	g_Render->GetDevice()->EndScene();    // ends the 3D scene

	g_Render->GetDevice()->Present(NULL, NULL, NULL, NULL);


}
void sa_TwFont::Clear()
{
}